import React from "react";
import { ResultPage, Card } from "antd-mobile";
import style from "./index.module.css";
import { UndoOutline } from "antd-mobile-icons";
import { Radio, Space } from "antd-mobile";
import { Button } from "antd-mobile";
import { useSelector } from "react-redux";
import  upzhuui  from '../../store/slice/ticketsilce'
import { useDispatch } from "react-redux";
import { useNavigate } from "react-router-dom";
import dayjs from "dayjs";
function Index() {
    const nav=useNavigate()
    const dispatch = useDispatch()
    const stret = useSelector((store) => store.ticket.stret);
    const end = useSelector((store) => store.ticket.end)
    const date = useSelector((store) => store.ticket.date);
  return (
    <div>
      <ResultPage
        status="success"
        title="操作成功"
        description="内容详情可折行，建议不超过两行建议不超过两行建议不超过两行"
      >
        <ResultPage.Card style={{ padding: 8 }}>
          <div className={style.box1}>
            <span className={style.z1}>{stret}</span>
            <UndoOutline fontSize={20} />
            <span className={style.z2}>{end}</span>
          </div>
          <div className={style.box1}>
            <div>
              <span className={style.z3}>
                {dayjs(date).format("YYYY-MM-DD")}
              </span>
              <span className={style.z5}>明日</span>
            </div>
          </div>
          <div className={style.box1}>
            <span>
              学生票 <Radio />
            </span>
            <span>
              高铁动车 <Radio />
            </span>
          </div>
          <div className={style.box1}>
            <Button
              block
              color="primary"
              size="large"
              onClick={() =>
                nav(
                  `/chepiao?start=${stret}&end=${end}&date=${date}&isSpeed=true`
                )
              }
            >
              Block Button
            </Button>
          </div>
        </ResultPage.Card>
      </ResultPage>
    </div>
  );
}

export default Index;
